/*
 * Copyright (c)  2017
 * All rights reserved.
 * ActivityAttrEntity.java 2017-09-17 下午1:37
 */

package com.ueboot.weishop.entity.activity;

import com.ueboot.weishop.entity.IDEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 描述:活动额外相关属性
 *
 * @author yangkui create on 2017-09-17 下午1:37.
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity(name = "WS_ACTIVITY_ATTR")
public class ActivityAttrEntity extends IDEntity{


    public static final String CUSTOMER_TYPE_A = "A";
    public static final String CUSTOMER_TYPE_B = "B";
    public static final String CUSTOMER_TYPE_C = "C";
    public static final String CUSTOMER_TYPE_OIL = "半合成机油客户";

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_ACTIVITY_ATTR")
    @GenericGenerator(name = "WS_ACTIVITY_ATTR", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_ACTIVITY_ATTR"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled")})
    @Column(name = "ID", columnDefinition = "INT(20) COMMENT 'id主键'", length = 20)
    private Long id;

    /**
     * 所属活动
     */
    @ManyToOne
    @JoinColumn(name="ACTIVITY_ID",columnDefinition = "INT(20) COMMENT '所属活动'")
    private ActivityEntity activity;

    /**
     * 所属活动代码
     */
    @Column(name="ACTIVITY_SN",columnDefinition = "INT(50) COMMENT '所属活动代码'")
    private String sn;

    /**
     * 属性KEY名称，唯一值。当字段名称
     */
    @Column(name = "KEY_NAME",columnDefinition = "VARCHAR(40) COMMENT '属性KEY，唯一值。当字段名称'",length = 40)
    private String keyName;

    /**
     * 属性名称
     */
    @Column(name = "NAME",columnDefinition = "VARCHAR(200) COMMENT '活动名称'",length = 200)
    private String name;

    /**
     * 属性值
     */
    @Column(name = "VALUE",columnDefinition = "VARCHAR(200) COMMENT '属性值'",length = 200)
    private String value;

    /**
     * 属性描述
     */
    @Column(name = "REMARK",columnDefinition = "VARCHAR(2000) COMMENT '属性描述'",length = 2000)
    private String remark;
}